<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function sum(arr) {
        let re = 0
        if (arr % 2 === 0) {
          re = arr / 2
        } else if ((arr - 1) % 2 === 0) {
          re = (arr - 1) / 2
        }
        return console.log(`您能换${re}瓶`)
      }
      sum(+prompt('请输入你的空瓶数'))
    </script>
  </body>
</html>
